﻿import QtQuick 2.15
import QtQuick.Controls 2.15

Rectangle {
    width: 300
    height: 200
    clip: true

    // 视口
    Flickable {
        id: flickable
        width: parent.width
        height: parent.height
        contentWidth: column.width
        contentHeight: column.height

        Column {
            id: column
            width: parent.width

            Repeater {
                model: 20
                Item {
                    width: parent.width
                    height: 50
                    Rectangle {
                        width: parent.width
                        height: 50
                        color: "lightblue"
                        border.color: "blue"
                        Text {
                            anchors.centerIn: parent
                            text: "Item " + (index + 1)
                        }
                    }
                }
            }
        }
    }
}
